/*
 * hal_canfd_communicator.c
 *
 *  Created on: 2025 Jul 6
 *      Author: SFLYs
 */
#include "hal_canfd_communicator.h"
#include "bsp_canfd.h"


void XT_Hal_CanFD_SendMessage(xt_hal_candevice candevice,xt_hal_canmessage_t *message)
{
    switch(candevice)
    {
    case XT_HAL_FLeg_CAN:
        Bsp_FLeg_CANFD_SendMessage(message->can_id,message->candata);
        break;
    case XT_HAL_RLeg_CAN:
        Bsp_RLeg_CANFD_SendMessage(message->can_id,message->candata);
        break;
    }
}

void XT_Hal_CANFD_RecvMessage(xt_hal_candevice candevice,xt_hal_canmessage_t *message)
{
    switch(candevice)
    {
    case XT_HAL_FLeg_CAN:
        message->can_id = Bsp_FLeg_CANFD_RecvMessage(message->candata);
        break;
    case XT_HAL_RLeg_CAN:
        message->can_id = Bsp_RLeg_CANFD_RecvMessage(message->candata);
        break;
    }
}


